/**
  ******************************************************************************
  * Copyright (C) 2020 - ~, SCUT-RobotLab Development Team
  * @file    RobotLauncher.h
  * @author  Mentos Seetoo
  * @brief   THis file includes all modules and start the program, using type 
  *          'float'.			
  * @note    
  * @warning 
  *     - At least C++11 is required.														 
  ******************************************************************************
  * @attention
  * 
  * if you had modified this file, please make sure there is no any bug in your
  * code. Update the version Number and write dowm your name and the date.What 
  * most important is that make sure the users will have a clear understanding
  * through your description.
  ******************************************************************************
  */
#pragma once
/* Includes ------------------------------------------------------------------*/
#include "Simulation/sim_interface.h"
#include "QuadrupedKernel.h"

/* Types define --------------------------------------------------------------*/
#define GAIT_TYPE  1 //JUMP/BOUNCE  1 / NO JUMP  0

using namespace Quadruped;
class RobotLauncher:private SimInterface
{
public:
#ifdef LOCAL_SIMULATION
    #if   GAIT_TYPE
    /*if gait type is JUMP/BOUNCE*/
    RobotLauncher():SimInterface(&kernel,"Sim-Thread", 0.000, ThreadType::MASTER),
                    kernel("Kernel-Thread",0.01, ThreadType::SLAVE){;};
    #else
    RobotLauncher():SimInterface(&kernel,"Sim-Thread", 0.000, ThreadType::INDEPENDENT),
                    kernel("Kernel-Thread",0.05, ThreadType::INDEPENDENT){;};
    #endif // !GAIT_TYPE
#else
    RobotLauncher():SimInterface(&kernel,"Sim-Thread", 1.000, ThreadType::INDEPENDENT),
                    kernel("Kernel-Thread",0.005, ThreadType::INDEPENDENT){};
#endif
    void LaunchAllProgram();

private:
    void _configSimulation();
    void _sendToSimulation();
    void _readFromSimulation();
    QuadrupedKernel<float> kernel;
};


/************************ COPYRIGHT(C) SCUT-ROBOTLAB **************************/